package com.itheima.api.calendar;

import java.util.Calendar;
import java.util.Scanner;

public class CalendarDemo02 {

    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入一个年");
        String next = scanner.next();

        int year = Integer.parseInt(next);

        Calendar calendar = Calendar.getInstance();
        calendar.set(year, 2, 1);
        calendar.add(Calendar.DAY_OF_MONTH, -1);
        System.out.println(calendar.get(Calendar.DAY_OF_MONTH));
    }
}
